package com.webchat.ugc.controller;

import com.webchat.common.bean.APIResponseBean;
import com.webchat.common.bean.APIResponseBeanUtil;
import com.webchat.domain.dto.payment.CallBackRequestBodyDTO;
import com.webchat.domain.dto.payment.PaymentResultDTO;
import com.webchat.rmi.ugc.UgcCallBackClient;
import com.webchat.ugc.service.CallBackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class UgcCallBackController implements UgcCallBackClient {


    @Autowired
    private CallBackService callBackService;


    @Override
    public APIResponseBean<Boolean> paymentCallBack(@RequestBody PaymentResultDTO callBackRequestBody) {

        boolean res = callBackService.doHandlePaymentCallback(callBackRequestBody);
        return APIResponseBeanUtil.success(res);
    }
}
